import requests

language = "中文"
entity_types = "组织,人物,设备,产品,技术,地点,事件,分类"
tuple_delimiter = "<|>"
record_delimiter = "##"
completion_delimiter = "<|COMPLETE|>"

url = "https://open.bigmodel.cn/api/paas/v4/chat/completions"
headers = {"Authorization": "Bearer <token>", "Content-Type": "application/json"}
jsonBody = {
  "model": "glm-4.5",
  "messages": [
    {
      "role": "system",
      "content": "你是一个有用的AI助手。"
    },
    {
      "role": "user",
      "content": "请介绍一下人工智能的发展历程。"
    }
  ],
  "temperature": 0.6,
  "max_tokens": 1024,
  "stream": False,
}

response = requests.post(url, headers=headers, json=jsonBody)
result = response.json()
print(result)

